<?php
/*************************************************************************************
   Copyright notice
   
   (c) 2002-2007 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
 
   This script is part of PHPWCMS. The PHPWCMS web content management system is
   free software; you can redistribute it and/or modify it under the terms of
   the GNU General Public License as published by the Free Software Foundation;
   either version 2 of the License, or (at your option) any later version.
  
   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license 
   from the author is found in LICENSE.txt distributed with these scripts.
  
   This script is distributed in the hope that it will be useful, but WITHOUT ANY 
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************

   JW Image Rotator Module v3 by breitsch (mail@casa-loca.com)

*************************************************************************************/

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
   die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------

// Imagerotator module content part form fields

// current module vars are stored in $phpwcms['modules'][$content["module"]]
// var to modules path: $phpwcms['modules'][$content["module"]]['path']

// before you can use module content part vars check if value is valid and what you are expect
// when defining modules vars it is always recommend to name t "modulename_varname".

define('PATH_IMG_BACKEND', $phpwcms['modules'][$content["module"]]['dir'].'img/');

//presettings for all vars
if(empty($content['imagerotator']['fmp_width'])) { $content['imagerotator']['fmp_width'] = 320;}
if(empty($content['imagerotator']['fmp_height'])) { $content['imagerotator']['fmp_height'] = 240;}
if(empty($content['imagerotator']['fmp_sort'])) { $content['imagerotator']['fmp_sort'] = 1;}
if(empty($content['imagerotator']['fmp_set_logo'])) { $content['imagerotator']['fmp_set_logo'] = '';}
if(empty($content['imagerotator']['fmp_set_hcolor'])) { $content['imagerotator']['fmp_set_hcolor'] = 'CC0000';}
if(empty($content['imagerotator']['fmp_set_color'])) { $content['imagerotator']['fmp_set_color'] = 'FFFFFF';}
if(empty($content['imagerotator']['fmp_set_bgcolor'])) { $content['imagerotator']['fmp_set_bgcolor'] = '000000';}
if(empty($content['imagerotator']['fmp_set_screencolor'])) { $content['imagerotator']['fmp_set_screencolor'] = '000000';}
if(!isset($content['imagerotator']['fmp_set_showcontrols'])) { $content['imagerotator']['fmp_set_showcontrols'] = 1;}
if(empty($content['imagerotator']['fmp_set_transition'])) { $content['imagerotator']['fmp_set_transition'] = 'random';}
if(empty($content['imagerotator']['fmp_set_shuffle'])) { $content['imagerotator']['fmp_set_shuffle'] = 0;}
if(empty($content['imagerotator']['fmp_set_flashversion'])) { $content['imagerotator']['fmp_set_flashversion'] = '9';}
if(empty($content['imagerotator']['fmp_set_overstretch'])) { $content['imagerotator']['fmp_set_overstretch'] = 'default';}
if(empty($content['imagerotator']['fmp_add_id'])) { $content['imagerotator']['fmp_add_id'] = 0;}
if(empty($content['imagerotator']['fmp_set_repeat'])) { $content['imagerotator']['fmp_set_repeat'] = 0;}
if(empty($content['imagerotator']['fmp_set_rotatetime'])) { $content['imagerotator']['fmp_set_rotatetime'] = '';}
if(empty($content['imagerotator']['cplayer_pos'])) { $content['imagerotator']['cplayer_pos'] = 0;}
if(empty($content['imagerotator']['fmp_script'])) { $content['imagerotator']['fmp_script'] = '';}
if(empty($content['imagerotator']['fmp_audio_file'])) { $content['imagerotator']['fmp_audio_file'] = '';}
if(empty($content['imagerotator']['fmp_audio_id'])) { $content['imagerotator']['fmp_audio_id'] = 0;}
if(empty($content['imagerotator']['fmp_set_useaudio'])) { $content['imagerotator']['fmp_set_useaudio'] = 0;}
if(empty($content['imagerotator']['fmp_set_kenburns'])) { $content['imagerotator']['fmp_set_kenburns'] = 0;}
if(empty($content['imagerotator']['fmp_set_hidetitles'])) { $content['imagerotator']['fmp_set_hidetitles'] = 0;}
if(empty($content['imagerotator']['fmp_set_volume'])) { $content['imagerotator']['fmp_set_volume'] = '';}
if(empty($content['imagerotator']['fmp_set_externalcomm'])) { $content['imagerotator']['fmp_set_externalcomm'] = 0;}
if(empty($content['imagerotator']['fmp_set_linktarget'])) { $content['imagerotator']['fmp_set_linktarget'] = '_blank';}
if(empty($content['imagerotator']['fmp_set_fullscreen'])) { $content['imagerotator']['fmp_set_fullscreen'] = 0;}
if(empty($content['imagerotator']['xml_title'])) { $content['imagerotator']['xml_title'] = '';}
if(empty($content['imagerotator']['fmp_set_wmode'])) { $content['imagerotator']['fmp_set_wmode'] = 'opaque';}

if(empty($content['imagerotator']['fields'])) {
  $content['imagerotator']['fields'][0] = array(
    'fmp_int_ext'				=> 0,
		'fmp_internal_id'			=> 0,
		'fmp_internal_dirid'			=> 0,
		'fmp_internal_name'			=> '',
		'fmp_external_file'			=> '',
		'fmp_title'				=> '',
		'fmp_link'					=> ''
    );
}

// format color - player 3.17 still '#......'
if($content['imagerotator']['fmp_set_hcolor'])		$content['imagerotator']['fmp_set_hcolor'] = '#'.$content['imagerotator']['fmp_set_hcolor'];
if($content['imagerotator']['fmp_set_bgcolor'])	$content['imagerotator']['fmp_set_bgcolor'] = '#'.$content['imagerotator']['fmp_set_bgcolor'];
if($content['imagerotator']['fmp_set_color'])		$content['imagerotator']['fmp_set_color'] = '#'.$content['imagerotator']['fmp_set_color'];
if($content['imagerotator']['fmp_set_screencolor'])		$content['imagerotator']['fmp_set_screencolor'] = '#'.$content['imagerotator']['fmp_set_screencolor'];

//header additions
$BE['HEADER']['contentpart.js'] = getJavaScriptSourceLink('include/inc_js/contentpart.js');

//mootools 1.11 from module not from system

//mootools
$mootools_more = array(
        'Drag/Drag',
        'Drag/Drag.Move',
        'Drag/Sortables'
);
initMootools('1.2', $mootools_more);
/*initMootools();*/
$BE['HEADER']['modimagerotator.js'] = getJavaScriptSourceLink('include/inc_module/mod_imagerotator/template/js/mod.imagerotator.js');
$BE['HEADER']['colorpicker.js'] = getJavaScriptSourceLink('include/inc_module/mod_imagerotator/template/js/colorpicker.js');
$BE['HEADER'][] = '<link href="include/inc_module/mod_imagerotator/template/css/colorpicker.css" rel="stylesheet" type="text/css" />';
$BE['HEADER'][] = '<link href="include/inc_module/mod_imagerotator/template/css/mootools.css" rel="stylesheet" type="text/css" />';
$BE['HEADER'][] = '<link href="include/inc_module/mod_imagerotator/template/css/imagerotator_cp.css" rel="stylesheet" type="text/css" />';

$BE['HEADER'][] = '<script language="JavaScript" type="text/javascript">
<!--
function changePlayerPos(x) {
//alert(x);
	document.articlecontent.cplayer_pos.selectedIndex = x;
	for(i=0; i<=7; i++)	{
		if(i==x) {
			MM_swapImage("playerpos"+i,"","img/symbole/content_selected.gif",0);
		} else {
			MM_swapImage("playerpos"+i,"","img/leer.gif",0);
		}
	}
}
function changePlayerPosMenu() {
	var x = document.articlecontent.cplayer_pos.selectedIndex;
	for(i=0; i<=7; i++)	{
		if(i==x) {
			MM_swapImage("playerpos"+i,"","img/symbole/content_selected.gif",0);
		} else {
			MM_swapImage("playerpos"+i,"","img/leer.gif",0);
		}
	}
	document.articlecontent.cplayer_pos.focus();
}
//used by colorpicker
function gid(name) {
	return document.getElementById(name);
}

//-->
</script>';

?>
<!-- top spacer - seperate from title/subtitle section -->
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- copyright -->
<tr>
	<td colspan="2" style="padding:0 10px 0 10px;background-color:#C2EB9A;">
	<p style="font-size:10px;">JW Player™ is licensed under a non-commercial Creative Commons License. For commercial use you have to order a special license.</p>
	</td>
</tr>

<tr><td colspan="2" class="chatlist" align="right"><a class="tdbottom3" href="#settings" name="filessection"><?php echo $BL['modules'][$content["module"]]['goto_settings'] ?></a><span><img src="<?php echo $phpwcms['modules'][$content["module"]]['dir'] ?>img/arrow_down.gif" alt="down" title="down" border="0" height="16" width="16"></span></td></tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>

<!-- xml descr -->
<tr>
    <td align="right" class="chatlist tdtop6" style="padding-right:5px;"><?php echo $BL['modules'][$content["module"]]['xml_title'] ?>:</td>
    <td style="padding-bottom:3px;"><input name="xml_title" type="text" maxlength="40" id="xml_title" class="v11 width350"  value="<?php echo html_specialchars($content['imagerotator']['xml_title']) ?>" size="40" /></td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- start file fields -->
<tr>
  <td colspan="2">
    <div id="imagescontainer">
    <ul id="rotatorImages">
<?php

	$field_counter			= 1;
	
	if (!$content['imagerotator']['fmp_add_id']) {
    $content['imagerotator']['fmp_add_id'] = 1;
  }
  
  $field_max				= $content['imagerotator']['fmp_add_id'];
	
  $i=1;
  //retrieve data for each field 
  foreach ($content['imagerotator']['fields'] as $key => $value) {
    $j=$key;
    $field_counter = $i;

?>
    <li id="sortme<?php echo $i ?>">
<!-- internal/external selection -->
      <table cellpadding="0" cellspacing="0" width="538">
        <tr>
        	<td style="padding-top:5px;"><table border="0" cellpadding="0" cellspacing="0" summary="">
        		<tr>
              <td colspan="1" align="left" id="formRow_<?php echo $i ?>">&nbsp;</td>
              <td colspan="1" align="left">
                <input name="fmp_order[]" type="hidden" id="fmp_order_<?php echo $i ?>" value="<?php echo $i ?>" />
                <span class="handle"><img src="include/inc_module/mod_imagerotator/img/sort_up_down.gif" alt="drag me" title="drag me" border="0" height="16" width="16"></span>
<?php
    if($content['imagerotator']['fmp_add_id']==1) {
      echo '                <input type="image" src="'.$phpwcms['modules'][$content["module"]]['dir'].'img/del_image_button1.gif" title="delete entry" />';
    } else {
      echo '                <input type="image" src="'.$phpwcms['modules'][$content["module"]]['dir'].'img/del_image_button1.gif" title="delete entry" onclick="document.getElementById(\'fmp_remove_id\').value='.$i.';document.getElementById(\'fmp_add_id\').value='.intval($content['imagerotator']['fmp_add_id']-1).'; this.form.submit();return false;" />';
    }

  $thumb_image = "";
  $file_sql  = "SELECT * FROM " .DB_PREPEND. "phpwcms_file WHERE f_id=" .$content['imagerotator']['fields'][$j]['fmp_internal_id']. " AND f_public=1 AND f_aktiv=1";

  $file_result = mysql_query($file_sql) or die ("error while listing files<br>".@htmlentities($file_sql, ENT_QUOTES, PHPWCMS_CHARSET));
  while($file_row = mysql_fetch_array($file_result)) {

    // 0   :1       :2   :3        :4    :5     :6      :7       :8
		// dbid:filename:hash:extension:width:height:caption:position:zoom
		$thumb_image = get_cached_image(
			 					array(	"target_ext"	=>	$file_row["f_ext"],
										"image_name"	=>	$file_row["f_hash"] . '.' . $file_row["f_ext"],
										"thumb_name"	=>	md5($file_row["f_hash"].$phpwcms["img_list_width"].$phpwcms["img_list_height"].$phpwcms["sharpen_level"])
        				)
    );
  }
?></td><td class="v10 tdbottom3 greyed" style="padding-top:5px;">&nbsp;[#<?php echo $i ?>]</td>
            </tr></table>
          </td>
	        <td class="v10 tdbottom3 greyed" style="padding-top:10px;">&nbsp;<i>JPG, PNG, GIF</i></td>
        </tr>
        <tr>
          <td width="120" align="left" id="img_preview_<?php echo $i ?>" class="chatlist tdtop3" style="padding:5px;">&nbsp;
<?php  if($content['imagerotator']['fields'][$j]['fmp_internal_dirid']) { ?>
            <img src="include/inc_module/mod_imagerotator/img/folder.gif" width="50" height="50" border="0" alt="" title="" />
<?php   } else if($thumb_image[0]) {      ?>  
            <img src="<?php echo PHPWCMS_IMAGES . $thumb_image[0]  ?>" border="0" <?php echo $thumb_image[3] ?> alt="" title="" />
<?php  }       ?>  
          </td>
          <td><table border="0" cellpadding="0" cellspacing="0" summary="">
		        <tr>
              <td bgcolor="#E7E8EB"><input name="fmp_int_ext[<?php echo $i ?>]" id="fmp_int_ext0_<?php echo $i ?>" type="radio" value="0" <?php is_checked(0, $content['imagerotator']['fields'][$j]['fmp_int_ext']); ?> /></td>
              <td bgcolor="#E7E8EB" class="v10"><label for="fmp_int_ext0_<?php echo $i ?>"><?php echo $BL['be_cnt_internal'] ?>&nbsp;</label></td>
              <td>&nbsp;<input name="fmp_internal_id[<?php echo $i ?>]" type="hidden" id="fmp_internal_id_<?php echo $i ?>" value="<?php echo $content['imagerotator']['fields'][$j]['fmp_internal_id'] ?>" />
                <input name="fmp_internal_dirid[<?php echo $i ?>]" type="hidden" id="fmp_internal_dirid_<?php echo $i ?>" value="<?php echo $content['imagerotator']['fields'][$j]['fmp_internal_dirid'] ?>" /></td>
              <td><input name="fmp_internal_name[<?php echo $i ?>]" type="text" id="fmp_internal_name_<?php echo $i ?>" class="f11b width300 greyed" value="<?php echo html_specialchars($content['imagerotator']['fields'][$j]['fmp_internal_name']) ?>" size="40" onfocus="this.blur()" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=7&amp;entry_id=<?php echo $i ?>');" /></td>
              <td><a href="#" title="<?php echo $BL['be_cnt_openmediabrowser'] ?>" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=7&amp;entry_id=<?php echo $i ?>');return false;"><img src="img/button/open_image_button.gif" alt="" border="0" hspace="3" /></a></td>
              <td><a href="#" title="<?php echo $BL['be_cnt_delmedia'] ?>" onclick="getObjectById('fmp_internal_name_<?php echo $i ?>').value='';getObjectById('fmp_internal_id_<?php echo $i ?>').value='0';this.blur();return false;"><img src="img/button/del_image_button.gif" alt="" border="0" /></a></td>
		        </tr>
		        <tr>
              <td colspan="6"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
		        </tr>
		        <tr>
              <td bgcolor="#E7E8EB"><input name="fmp_int_ext[<?php echo $i ?>]" id="fmp_int_ext1_<?php echo $i ?>" type="radio" value="1" <?php is_checked(1, $content['imagerotator']['fields'][$j]['fmp_int_ext']); ?> /></td>
              <td bgcolor="#E7E8EB" class="v10"><label for="fmp_int_ext1_<?php echo $i ?>"><?php echo $BL['be_cnt_external'] ?>&nbsp;</label></td>
              <td>&nbsp;</td>
              <td colspan="3"><input name="fmp_external_file[<?php echo $i ?>]" type="text" id="fmp_external_file_<?php echo $i ?>" class="f11b width300" value="<?php echo html_specialchars($content['imagerotator']['fields'][$j]['fmp_external_file']) ?>" size="30" />
              </td>
		        </tr>
		        <tr>
              <td colspan="6"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
		        </tr>
<!-- title -->
            <tr>
              <td colspan="3" align="right" class="chatlist tdtop6"><?php echo $BL['modules'][$content["module"]]['flashplayer_title'] ?>:&nbsp;</td>
              <td colspan="3" style="padding-bottom:3px;"><input name="fmp_title[<?php echo $i ?>]" type="text" id="fmp_title_<?php echo $i ?>" class="v11 width300"  value="<?php echo html_specialchars($content['imagerotator']['fields'][$j]['fmp_title']) ?>" size="30" /></td>
            </tr>
<!-- link -->
            <tr>
              <td colspan="3" align="right" class="chatlist tdtop6"><?php echo $BL['be_admin_page_link'] ?>:&nbsp;</td>
              <td colspan="3" style="padding-bottom:3px;"><input name="fmp_link[<?php echo $i ?>]" type="text" id="fmp_link_<?php echo $i ?>" class="v11 width300" value="<?php echo html_specialchars($content['imagerotator']['fields'][$j]['fmp_link']) ?>" size="30" /></td>
            </tr>
          </table></td>
        </tr>

        <tr><td colspan="2" class="rowspacer7x0"></td></tr>
      </table>
    </li>
<?php

		$i++;
} //end for

    //when add new field... same thing as above but empty
    if ($content['imagerotator']['fmp_add_id']>count($content['imagerotator']['fields'])) {
      $field_counter = $i;

?>
    <li id="sortme<?php echo $i ?>">
      <table cellpadding="0" cellspacing="0" width="538">	
<!-- internal/external selection -->
        <tr>
          <td style="padding-top:5px;"><table border="0" cellpadding="0" cellspacing="0" summary="">
            <tr>
              <td colspan="1" align="left" id="formRow_<?php echo $i ?>">&nbsp;</td>
              <td colspan="1" align="left">
                <input name="fmp_order[]" type="hidden" id="fmp_order_<?php echo $i ?>" value="<?php echo $i ?>" />
                <span class="handle"><img src="include/inc_module/mod_imagerotator/img/sort_up_down.gif" alt="drag me" title="drag me" border="0" height="16" width="16"></span>
<?php
    if($content['imagerotator']['fmp_add_id']==1) {
      echo '                <input type="image" src="'.$phpwcms['modules'][$content["module"]]['dir'].'img/del_image_button1.gif" title="delete entry" />';
    } else {
      echo '                <input type="image" src="'.$phpwcms['modules'][$content["module"]]['dir'].'img/del_image_button1.gif" title="delete entry" onclick="document.getElementById(\'fmp_remove_id\').value='.$i.';document.getElementById(\'fmp_add_id\').value='.intval($content['imagerotator']['fmp_add_id']-1).'; this.form.submit();return false;" />';
    }
?></td><td class="v10 tdbottom3 greyed" style="padding-top:5px;">&nbsp;[#<?php echo $i ?>]</td>
            </tr></table>
          </td>
          <td class="v10 tdbottom3 greyed" style="padding-top:10px;">&nbsp;<i>JPG, PNG, GIF</i></td>
        </tr>
        <tr>
          <td width="120" align="left" id="img_preview_<?php echo $i ?>" class="chatlist tdtop3" style="padding:5px;">&nbsp;
          </td>
          <td><table border="0" cellpadding="0" cellspacing="0" summary="">
            <tr>
              <td bgcolor="#E7E8EB"><input name="fmp_int_ext[<?php echo $i ?>]" id="fmp_int_ext0_<?php echo $i ?>" type="radio" value="0" checked="checked" /></td>
              <td bgcolor="#E7E8EB" class="v10"><label for="fmp_int_ext0_<?php echo $i ?>"><?php echo $BL['be_cnt_internal'] ?>&nbsp;</label></td>
              <td>&nbsp;<input name="fmp_internal_id[<?php echo $i ?>]" type="hidden" id="fmp_internal_id_<?php echo $i ?>" value="" /></td>
                <input name="fmp_internal_dirid[<?php echo $i ?>]" type="hidden" id="fmp_internal_dirid_<?php echo $i ?>" value="" /></td>
              <td><input name="fmp_internal_name[<?php echo $i ?>]" type="text" id="fmp_internal_name_<?php echo $i ?>" class="f11b width300 greyed" value="" size="40" onfocus="this.blur()" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=7&entry_id=<?php echo $i ?>');" /></td>
              <td><a href="#" title="<?php echo $BL['be_cnt_openmediabrowser'] ?>" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=7&entry_id=<?php echo $i ?>');return false;"><img src="img/button/open_image_button.gif" alt="" border="0" hspace="3" /></a></td>
              <td><a href="#" title="<?php echo $BL['be_cnt_delmedia'] ?>" onclick="getObjectById('fmp_internal_name_<?php echo $i ?>').value='';getObjectById('fmp_internal_id_<?php echo $i ?>').value='0';this.blur();return false;"><img src="img/button/del_image_button.gif" alt="" border="0" /></a></td>
		        </tr>
		        <tr>
              <td colspan="6"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
		        </tr>
		        <tr>
              <td bgcolor="#E7E8EB"><input name="fmp_int_ext[<?php echo $i ?>]" id="fmp_int_ext1_<?php echo $i ?>" type="radio" value="1" /></td>
              <td bgcolor="#E7E8EB" class="v10"><label for="fmp_int_ext1_<?php echo $i ?>"><?php echo $BL['be_cnt_external'] ?>&nbsp;</label></td>
              <td>&nbsp;</td>
              <td colspan="3"><input name="fmp_external_file[<?php echo $i ?>]" type="text" id="fmp_external_file_<?php echo $i ?>" class="f11b width300" value="" size="40" />
              </td>
		        </tr>
		        <tr>
              <td colspan="6"><img src="img/leer.gif" alt="" width="1" height="3" /></td>
		        </tr>
<!-- title -->
            <tr>
              <td colspan="3" align="right" class="chatlist tdtop6"><?php echo $BL['modules'][$content["module"]]['flashplayer_title'] ?>:&nbsp;</td>
              <td colspan="3" style="padding-bottom:3px;"><input name="fmp_title[<?php echo $i ?>]" type="text" id="fmp_title_<?php echo $i ?>" class="v11 width300" value="" size="30" /></td>
            </tr>
<!-- link -->
            <tr>
              <td colspan="3" align="right" class="chatlist tdtop6"><?php echo $BL['be_admin_page_link'] ?>:&nbsp;</td>
              <td colspan="3" style="padding-bottom:3px;"><input name="fmp_link[<?php echo $i ?>]" type="text" id="fmp_link_<?php echo $i ?>" class="v11 width300" value="" size="30" /></td>
            </tr>
          </table></td>
        </tr>
        <tr><td colspan="2" class="rowspacer7x0"></td></tr>
      </table>
    </li>
<?php
	
		$i++;
} //end if

?>	
    </ul>
    </div>
  </td>
</tr>
<!-- add new image button -->
<tr>
	<td colspan="2">
	<input name="fmp_remove_id" type="hidden" id="fmp_remove_id" value="" />
  <input name="fmp_add_id" type="hidden" id="fmp_add_id" value="<?php echo intval($content['imagerotator']['fmp_add_id']) ?>" />
  <input name="fmp_add_send" type="button" class="v09" value="<?php echo $BL['modules'][$content["module"]]['add_new'] ?>" onclick="document.getElementById('fmp_add_id').value='<?php echo intval($content['imagerotator']['fmp_add_id']+1) ?>'; this.form.submit()" />
  &nbsp;&nbsp;<?php echo $BL['modules'][$content["module"]]['add_new_save'] ?></td>
</tr>
<!-- end file fields -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="30" /></td></tr>
<!-- start settings -->
<tr>
  <td colspan="2" class="chatlist" align="right"><a class="tdbottom3" href="#filessection" name="settings"><?php echo $BL['modules'][$content["module"]]['goto_fileslisting'] ?></a><span><img src="<?php echo $phpwcms['modules'][$content["module"]]['dir'] ?>img/arrow_up.gif" alt="down" title="down" border="0" height="16" width="16"></span></td>
</tr>
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['be_settings'] ?>:&nbsp;</td>
  <td></td>
</tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- player size -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['fmp_set_player'] ?>:&nbsp;</td>
  <td><table border="0" cellpadding="0" cellspacing="0" summary="" class="settings">
    <tr>
      <td><select name="fmp_width_height" id="fmp_width_height" class="f10" onchange="setPlayerSize(this)">
				  <option><?php echo $BL['modules'][$content["module"]]['flashplayer_selectsize'] ?></option>
				  <option value="200x178">200 x 178 px</option>
				  <option value="320x240">320 x 240 px</option>
				  <option value="380x313">380 x 313 px</option>
				  <option value="425x350">425 x 350 px</option>
				  <option value="450x338">450 x 338 px</option>
				  <option value="500x403">500 x 403 px</option>
				  <option value="640x480">640 x 480 px</option>			
			  </select></td>
			  <td>&nbsp;&nbsp;</td>			
			  <td class="chatlist"><?php echo $BL['modules'][$content["module"]]['fmp_set_playerwidth'] ?>&nbsp;</td><td><input name="fmp_width" type="text" class="f11b width30" id="fmp_width" size="4" maxlength="4" value="<?php echo $content['imagerotator']['fmp_width']  ?>" /></td>
			  <td class="chatlist">&nbsp;px&nbsp;&nbsp;</td>
			  <td class="chatlist"><?php echo $BL['modules'][$content["module"]]['fmp_set_playerheight'] ?>&nbsp;</td><td><input name="fmp_height" type="text" class="f11b width30" id="fmp_height" size="4" maxlength="4" value="<?php echo $content['imagerotator']['fmp_height']  ?>" /></td>
			  <td class="chatlist">&nbsp;px</td>
		</tr></table>
  </td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<!-- wmode -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['wmode'] ?>:&nbsp;</td>
  <td align="left"><select name="fmp_set_wmode" id="fmp_set_wmode" class="f10">			
			<option value="opaque"<?php is_selected('opaque', $content['imagerotator']['fmp_set_wmode']) ?>><?php echo $BL['modules'][$content["module"]]['wmode_op'] ?></option>
			<option value="transparent"<?php is_selected('transparent', $content['imagerotator']['fmp_set_wmode']) ?>><?php echo $BL['modules'][$content["module"]]['wmode_tr'] ?></option>
  </select>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<!-- streching -->
<tr>
  <td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['display'] ?>:&nbsp;</td>
	<td><table border="0" cellpadding="0" cellspacing="0" summary="">
		<tr>
      <td><select name="fmp_set_overstretch" id="fmp_set_overstretch" class="f10">
			<option value="default"<?php is_selected('default', $content['imagerotator']['fmp_set_overstretch']) ?>><?php echo $BL['modules'][$content["module"]]['display_default'] ?></option>
			<option value="fit"<?php is_selected('fit', $content['imagerotator']['fmp_set_overstretch']) ?>><?php echo $BL['modules'][$content["module"]]['display_strech01'] ?></option>
			<option value="none"<?php is_selected('none', $content['imagerotator']['fmp_set_overstretch']) ?>><?php echo $BL['modules'][$content["module"]]['display_original'] ?></option>
			<option value="false"<?php is_selected('false', $content['imagerotator']['fmp_set_overstretch']) ?>><?php echo $BL['modules'][$content["module"]]['display_strech02'] ?></option>
			<option value="true"<?php is_selected('true', $content['imagerotator']['fmp_set_overstretch']) ?>><?php echo $BL['modules'][$content["module"]]['display_strech03'] ?></option>
			</select></td>
    </tr></table>
  </td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<!-- player position in website -->
<tr>
	<td align="right" class="chatlist"><?php echo $BL['be_cnt_position'] ?>:&nbsp;</td>
	<td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
		<tr>
			<td><select name="cplayer_pos" class="f10" id="cplayer_pos" onChange="changePlayerPosMenu();">
			    <option value="0" <?php is_selected(0, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos0'] ?></option>
			    <option value="1" <?php is_selected(1, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos1'] ?></option>
			    <option value="2" <?php is_selected(2, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos2'] ?></option>
			    <option value="3" <?php is_selected(3, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos3'] ?></option>
			    <option value="4" <?php is_selected(4, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos4'] ?></option>
			    <option value="5" <?php is_selected(5, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos5'] ?></option>
			    <option value="6" <?php is_selected(6, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos6'] ?></option>
			    <option value="7" <?php is_selected(7, $content['imagerotator']['cplayer_pos']) ?>><?php echo $BL['be_cnt_pos7'] ?></option>
		      </select></td>
			<td><img src="img/leer.gif" alt="" width="3" height="1"></td>
			<td><img src="img/symbole/content_selected.gif" alt="" name="playerpos0" width="7" height="10" id="playerpos0"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(0);this.blur();return false;" title="<?php echo $BL['be_cnt_pos0i'] ?>"><img src="img/button/image_pos0.gif" alt="" width="15" height="15" border="0"></a></td>
			<td><img src="img/leer.gif" alt="" name="playerpos1" width="7" height="10" id="playerpos1"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(1);this.blur();return false;" title="<?php echo $BL['be_cnt_pos1i'] ?>"><img src="img/button/image_pos1.gif" alt="" width="15" height="15" border="0"></a></td>
			<td><img src="img/leer.gif" alt="" name="playerpos2" width="7" height="10" id="playerpos2"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(2);this.blur();return false;" title="<?php echo $BL['be_cnt_pos2i'] ?>"><img src="img/button/image_pos2.gif" alt="" width="15" height="15" border="0"></a></td>
			<td><img src="img/leer.gif" alt="" name="playerpos3" width="7" height="10" id="playerpos3"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(3);this.blur();return false;" title="<?php echo $BL['be_cnt_pos3i'] ?>"><img src="img/button/image_pos3.gif" alt="" width="15" height="15" border="0"></a></td>
			<td><img src="img/leer.gif" alt="" name="playerpos4" width="7" height="10" id="playerpos4"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(4);this.blur();return false;" title="<?php echo $BL['be_cnt_pos4i'] ?>"><img src="img/button/image_pos4.gif" alt="" width="15" height="15" border="0"></a></td>
		  <td><img src="img/leer.gif" alt="" name="playerpos5" width="7" height="10" id="playerpos5"></td>
		  <td><a href="javascript:;" onclick="changePlayerPos(5);this.blur();return false;" title="<?php echo $BL['be_cnt_pos5i'] ?>"><img src="img/button/image_pos5.gif" alt="" width="15" height="15" border="0"></a></td>
		  <td><img src="img/leer.gif" alt="" name="playerpos6" width="7" height="10" id="playerpos6"></td>
		  <td><a href="javascript:;" onclick="changePlayerPos(6);this.blur();return false;" title="<?php echo $BL['be_cnt_pos6i'] ?>"><img src="img/button/image_pos6.gif" alt="" width="15" height="15" border="0"></a></td>
			<td><img src="img/leer.gif" alt="" name="playerpos7" width="7" height="10" id="playerpos7"></td>
			<td><a href="javascript:;" onclick="changePlayerPos(7);this.blur();return false;" title="<?php echo $BL['be_cnt_pos7i'] ?>"><img src="img/button/image_pos7.gif" alt="" width="15" height="15" border="0"></a></td>
		</tr>
	</table>
<script language="javascript" type="text/javascript">
<!--
changePlayerPos(<?php echo intval($content['imagerotator']['cplayer_pos']); ?>);
//-->
</script>
</td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>  
<!-- colors -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['fmp_set_player_colors'] ?>:&nbsp;</td>
  <td><div id='colors'><table border="0" cellpadding="0" cellspacing="0" summary="" class="settings">
    <tr>
			<td width="20"><input name="fmp_set_bgcolor" type="text" id="fmp_set_bgcolor" class="f11b width75" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_bgcolor']) ?>" size="40" maxlength="7" /></td>			
			<td align="left"><a href="javascript:pickColor('fmp_set_bgcolor');" class="pick" id="fmp_set_bgcolorpick" style="display: block;width: 15px;height: 15px;background-color:<?php echo html_specialchars($content['imagerotator']['fmp_set_bgcolor']) ?>;"> </a></td>
      <td class="chatlist" align="left">&nbsp;<label for="fmp_set_bgcolor"><?php echo $BL['modules'][$content["module"]]['bg_color'] ?></label></td>
		</tr>
		
		<tr>
			<td width="20"><input name="fmp_set_color" type="text" id="fmp_set_color" class="f11b width75" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_color']) ?>" size="40" maxlength="7" /></td>
			<td align="left"><a href="javascript:pickColor('fmp_set_color');" class="pick" id="fmp_set_colorpick" style="display: block;width: 15px;height: 15px;background-color:<?php echo html_specialchars($content['imagerotator']['fmp_set_color']) ?>;"> </a></td>
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_color"><?php echo $BL['modules'][$content["module"]]['f_color'] ?></label></td>
		</tr>
		
		<tr>
			<td width="20"><input name="fmp_set_hcolor" type="text" id="fmp_set_hcolor" class="f11b width75" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_hcolor']) ?>" size="40" maxlength="7" /></td>
			<td align="left"><a href="javascript:pickColor('fmp_set_hcolor');" class="pick" id="fmp_set_hcolorpick" style="display: block;width: 15px;height: 15px;background-color:<?php echo html_specialchars($content['imagerotator']['fmp_set_hcolor']) ?>;"> </a></td>
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_hcolor"><?php echo $BL['modules'][$content["module"]]['hl_color'] ?></label></td>
		</tr>

		<tr>
			<td width="20"><input name="fmp_set_screencolor" type="text" id="fmp_set_screencolor" class="f11b width75" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_screencolor']) ?>" size="40" maxlength="7" /></td>
			<td align="left"><a href="javascript:pickColor('fmp_set_screencolor');" class="pick" id="fmp_set_screencolorpick" style="display: block;width: 15px;height: 15px;background-color:<?php echo html_specialchars($content['imagerotator']['fmp_set_screencolor']) ?>;"> </a></td>
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_screencolor"><?php echo $BL['modules'][$content["module"]]['screen_color'] ?></label></td>
		</tr>
  </table></div></td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
 <!-- autostart -->
<tr>
  <td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['fmp_set_play'] ?>:&nbsp;</td>
  <td><table border="0" cellpadding="0" cellspacing="0" width="100%" summary="">
			<tr>
        <td><table border="0" cellpadding="0" cellspacing="0" summary="">
            <tr>
              <td><input type="checkbox" name="fmp_set_repeat" id="fmp_set_repeat" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_repeat']) ?> /></td>
              <td class="chatlist" align="left">&nbsp;<label for="fmp_set_repeat"><?php echo $BL['modules'][$content["module"]]['fmp_set_repeat'] ?></label></td>
			        <td>&nbsp;&nbsp;&nbsp;<input type="checkbox" name="fmp_set_shuffle" id="fmp_set_shuffle" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_shuffle']) ?> /></td>
              <td class="chatlist" align="left">&nbsp;<label for="fmp_set_shuffle"><?php echo $BL['modules'][$content["module"]]['fmp_set_shuffle'] ?></label></td>
		        </tr></table>
		    </td>
		  </tr>		
    	<tr>		
			  <td><table border="0" cellpadding="0" cellspacing="0" summary="">
            <tr>
              <td><input type="checkbox" name="fmp_set_kenburns" id="fmp_set_kenburns" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_kenburns']) ?> /></td>
              <td class="chatlist" align="left">&nbsp;<label for="fmp_set_kenburns"><?php echo $BL['modules'][$content["module"]]['fmp_set_kenburns'] ?></label></td>
		        </tr></table>
		    </td>
		  </tr>
		  <tr>		
			 <td><table border="0" cellpadding="0" cellspacing="0" summary="">
				  <tr>
            <td><input name="fmp_set_rotatetime" type="text" class="f11b width30" id="fmp_width" size="4" maxlength="4" value="<?php echo $content['imagerotator']['fmp_set_rotatetime']  ?>" /></td>
			      <td class="chatlist" align="left">&nbsp;<label for="fmp_set_rotatetime"><?php echo $BL['modules'][$content["module"]]['fmp_set_rotatetime'] ?></label></td>
		      </tr></table>
		   </td>
		  </tr>
      <tr><td><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
      <tr>
        <td><table border="0" cellpadding="0" cellspacing="0" summary="">
            <tr>
              <td class="chatlist" align="left"><label for="fmp_set_transition"><?php echo $BL['modules'][$content["module"]]['fmp_set_transition'] ?>:&nbsp;</label></td>
			        <td><select name="fmp_set_transition" id="fmp_set_transition" class="f10">			
			<option value="random"<?php is_selected('random', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_random'] ?></option>
			<option value="fade"<?php is_selected('fade', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_fade'] ?></option>
			<option value="bgfade"<?php is_selected('bgfade', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_bgfade'] ?></option>
			<option value="slowfade"<?php is_selected('slowfade', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_slowfade'] ?></option>
			<option value="blocks"<?php is_selected('blocks', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_blocks'] ?></option>
			<option value="bubbles"<?php is_selected('bubbles', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_bubbles'] ?></option>
			<option value="circles"<?php is_selected('circles', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_circles'] ?></option>
			<option value="flash"<?php is_selected('flash', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_flash'] ?></option>
			<option value="fluids"<?php is_selected('fluids', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_fluids'] ?></option>
			<option value="lines"<?php is_selected('lines', $content['imagerotator']['fmp_set_transition']) ?>><?php echo $BL['modules'][$content["module"]]['display_lines'] ?></option>
              </select></td>
            </tr></table>
        </td>
		  </tr>
		  <tr><td><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>  
    </table>
	</td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<!-- logo -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['watermark_logo'] ?>:&nbsp;</td>
  <td align="left"><input name="fmp_set_logo" type="text" id="fmp_set_logo" class="v11 width350" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_logo']) ?>" size="40" /></td>
</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<!-- link target -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['link_target'] ?>:&nbsp;</td>
  <td align="left"><select name="fmp_set_linktarget" id="fmp_set_linktarget" class="f10">			
			<option value="_blank"<?php is_selected('_blank', $content['imagerotator']['fmp_set_linktarget']) ?>><?php echo $BL['modules'][$content["module"]]['linktarget_blank'] ?></option>
			<option value="_self"<?php is_selected('_self', $content['imagerotator']['fmp_set_linktarget']) ?>><?php echo $BL['modules'][$content["module"]]['linktarget_self'] ?></option>
  </select>
</tr>
<!-- end settings -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="7" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- controls -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['fmp_set_opt_controls'] ?>:&nbsp;</td>
  <td><table border="0" cellpadding="0" cellspacing="0" summary="" class="settings">
		<tr>
		  <td width="20"><input type="checkbox" name="fmp_set_showcontrols" id="fmp_set_showcontrols" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_showcontrols']) ?> /></td>		  
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_showcontrols"><?php echo $BL['modules'][$content["module"]]['show_controls'] ?></label></td>
    </tr>
    <tr>
		  <td width="20"><input type="checkbox" name="fmp_set_hidetitles" id="fmp_set_hidetitles" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_hidetitles']) ?> /></td>		  
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_hidetitles"><?php echo $BL['modules'][$content["module"]]['fmp_set_hidetitles'] ?></label></td>
    </tr>
    <tr>
		  <td width="20"><input type="checkbox" name="fmp_set_fullscreen" id="fmp_set_fullscreen" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_fullscreen']) ?> /></td>		  
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_fullscreen"><?php echo $BL['modules'][$content["module"]]['fmp_set_fullscreen'] ?></label></td>
    </tr>
  </table></td>
</tr>
<!-- end controls -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="7" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- audio -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['flashplayer_audio'] ?>:&nbsp;</td>
	<td style="padding-top:3px;padding-bottom:5px;"><table border="0" cellpadding="0" cellspacing="0" summary="">
		<tr>
			<td><input name="fmp_audio_file" type="text" id="fmp_audio_file_1" class="f11b width300 greyed" value="<?php echo html_specialchars($content['imagerotator']['fmp_audio_file']) ?>" size="40" onfocus="this.blur()" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=2&entry_id=1');" /></td>
			<td><a href="#" title="<?php echo $BL['be_cnt_openmediabrowser'] ?>" onclick="openFileBrowserImagerotatorMod('include/inc_module/mod_imagerotator/filebrowser.php?opt=2&entry_id=1');return false;"><img src="img/button/open_image_button.gif" alt="" border="0" hspace="3" /></a></td>
			<td><a href="#" title="<?php echo $BL['be_cnt_delmedia'] ?>" onclick="getObjectById('fmp_audio_file_1').value='';getObjectById('fmp_audio_id_1').value='0';this.blur();return false;"><img src="img/button/del_image_button.gif" alt="" border="0" /></a>
			<input name="fmp_audio_id" type="hidden" id="fmp_audio_id_1" value="<?php echo $content['imagerotator']['fmp_audio_id'] ?>" />			
			</td>
		</tr>
	</table></td>
</tr>
<tr>
	<td align="right" class="chatlist tdtop3">&nbsp;</td>
	<td><table border="0" cellpadding="0" cellspacing="0" summary="">
		<tr>
			<td width="20"><input type="checkbox" name="fmp_set_useaudio" id="fmp_set_useaudio" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_useaudio']) ?> /></td>		  
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_useaudio"><?php echo $BL['modules'][$content["module"]]['flashplayer_audio_startmute'] ?></label></td>
      <td>&nbsp;&nbsp;&nbsp;<input name="fmp_set_volume" type="text" class="f11b width30" id="fmp_set_volume" size="4" maxlength="4" value="<?php echo $content['imagerotator']['fmp_set_volume']  ?>" /></td>
			<td class="chatlist" align="left">&nbsp;<label for="fmp_set_volume"><?php echo $BL['modules'][$content["module"]]['fmp_set_volume'] ?></label></td>
    </tr>
	</table></td>
</tr>
<!-- end audio -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="7" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- versionazing -->
<tr>
	<td align="right" class="chatlist tdtop3"><?php echo $BL['modules'][$content["module"]]['flash_version'] ?>:&nbsp;</td>
  <td><table border="0" cellpadding="0" cellspacing="0" summary="" class="settings">    		
		<tr>
			<td><input name="fmp_set_flashversion" type="text" id="fmp_set_flashversion" class="f11b width30" value="<?php echo html_specialchars($content['imagerotator']['fmp_set_flashversion']) ?>" size="6" maxlength="6" />&nbsp;<?php echo $BL['modules'][$content["module"]]['flash_version_expl'] ?></td>
		</tr>
	</table></td>
</tr>
<!-- end versionazing -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="7" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- additional API -->
<tr>
  <td align="right" class="chatlist tdtop3">&nbsp;</td>
	<td class="chatlist" align="left"><table border="0" cellpadding="0" cellspacing="0" summary=""><tr><td><input type="checkbox" name="fmp_set_externalcomm" id="fmp_set_externalcomm" value="1"<?php is_checked(1, $content['imagerotator']['fmp_set_externalcomm']) ?> /></td><td>&nbsp;<label for="fmp_set_externalcomm"><?php echo $BL['modules'][$content["module"]]['fmp_set_enablejs'] ?></label></td></tr></table></td>
</tr>
<tr>
  <td align="right" valign="top" class="chatlist"><div style="padding:5px;"><?php echo $BL['modules'][$content["module"]]['script'] ?>:</div></td>
  <td>
  <div style="float:right;padding:2px;padding-right:50px;">
		<a href="#rtp_anchor2" onclick="contractField('fmp_script', 'V')"><img src="img/button/minus_11x11.gif" border="0" alt="-" width="11" height="11"></a><a href="#rtp_anchor2" onclick="growField('fmp_script', 'V')"><img src="img/button/add_11x11.gif" border="0" alt="+" width="11" height="11"></a>
		</div>
    <textarea rows="4" name="fmp_script" cols="45" wrap='OFF' class='msgtext' id='fmp_script' style='width:350px'><?php echo $content['imagerotator']['fmp_script']; ?></textarea>
  </td>
</tr>
<tr>
  <td align="right" valign="top" class="chatlist"></td>
  <td>
  <div class="chatlist">the div element that holds this Player Instance has id "MODfir<?php echo $content['id']; ?>" 
  <br />the js variable to add variables to is: fir<?php echo $content['id']; ?> 
  <br />to add new variables use e.g. fir<?php echo $content['id']; ?>flashvars.transition = "blocks";
  <br />to send events to the player use e.g.: sendEvent('MODfir<?php echo $content['id']; ?>','stop');
  <br /><a href="http://web.casa-loca.com/index.php?aid=79" target="_blank"><strong>see the javascript API page in the docu</strong></a>
  </div>
  </td>
</tr>
<!-- end additional API -->

<tr>
	<td colspan="2"><script language="javascript" type="text/javascript">
		<!--

    window.addEvent('domready', function() {
      var sortlist = new Sortables( 'rotatorImages', {
        handles: "span.handle",
        constrain: true,
        clone: true,
        revert: true,
        snap: 5,

        /* once an item is selected */
        onStart: function(el,clone) {
          el.setStyle('background','#FFFFDD');
          clone.setStyle('background','#d9dee3');
		    },
        onComplete: function(el,clone) {
          el.setStyle('background','#F3F5F8');
          //el.highlight('#CCFFCC', '#F3F5F8');
		    },
		    onSort: function(el,clone) {
          el.setStyle('background','#FFFFDD');
		    }

      });

     document.ondragstart = function() {
      return false;
     };

    });


    function setIdName(file_id, file_name, entry_id_nr) {
			if(file_id == null) file_id=0;
			if(file_name == null) file_name='';
			getObjectById('fmp_internal_id_'+entry_id_nr).value = file_id;
			getObjectById('fmp_internal_dirid_'+entry_id_nr).value = 0;
			getObjectById('fmp_internal_name_'+entry_id_nr).value = file_name;
			updatePreviewImage(file_id, entry_id_nr);
		}
		function setImgIdName(file_id, file_name, entry_id_nr) {
			if(file_id == null) file_id=0;
			if(file_name == null) file_name='';
			getObjectById('fmp_internal_id_'+entry_id_nr).value = file_id;
			getObjectById('fmp_internal_dirid_'+entry_id_nr).value = 0;
			getObjectById('fmp_internal_name_'+entry_id_nr).value = file_name;
			updatePreviewImage(file_id, entry_id_nr);
		}
		function setDirIdName(file_id, file_name, entry_id_nr) {
			if(file_id == null) file_id=0;
			if(file_name == null) file_name='';
			getObjectById('fmp_internal_dirid_'+entry_id_nr).value = file_id;
			getObjectById('fmp_internal_id_'+entry_id_nr).value = 0;
			getObjectById('fmp_internal_name_'+entry_id_nr).value = file_name;
			updatePreviewImage(file_id, entry_id_nr);
		}
		function setAudioIdName(file_id, file_name, entry_id_nr) {
			if(file_id == null) file_id=0;
			if(file_name == null) file_name='';
			getObjectById('fmp_audio_id_'+entry_id_nr).value = file_id;
			getObjectById('fmp_audio_file_'+entry_id_nr).value = file_name;
		}		
		function setPlayerSize(sval) {
			var indx = sval.selectedIndex;
			if(indx > 0) {
				var val = sval.options[indx].value.split('x');
				getObjectById('fmp_width').value = parseInt(val[0]);
				getObjectById('fmp_height').value = parseInt(val[1]);
			}
			sval.options[0].selected = true;
			sval.blur();
		}
		var site_url	= '<?php echo PHPWCMS_URL; ?>';
    var max_img_w	= <?php echo $phpwcms['img_list_width']; ?>;
    var max_img_h	= <?php echo $phpwcms['img_list_height']; ?>;
		
	function updatePreviewImage(image_number,entry_id_nr) {
		var preview = '';
		var image_dir_id = $('fmp_internal_dirid_'+entry_id_nr).value;
		var image_file_id = $('fmp_internal_id_'+entry_id_nr).value;
		if(image_dir_id !=0) {
			preview = getBackendDirImgSrc( image_number );
		} else if(image_file_id) {
			preview = getBackendImgSrc( image_number );
		}
		$('img_preview_'+entry_id_nr).set('html',preview);
	}
	function getBackendImgSrc(image_file_id) {
		var image_file_id = parseInt(image_file_id);
		if(image_file_id) {
			return '<'+'img src="'+site_url+'img/cmsimage.php/'+max_img_w+'x'+max_img_h+'/'+image_file_id+'" border="0" alt="" /'+'> ';
		}
		return '';
	}
	function getBackendDirImgSrc(image_file_id) {
		var image_file_id = parseInt(image_file_id);
		if(image_file_id) {
			return '<'+'img src="'+site_url+'<?php echo $phpwcms['modules'][$content["module"]]['dir']; ?>img/folder.gif" width="50" height="50" border="0" alt="" /'+'> ';
		}
		return '';
	}
		//-->
		</script>
  </td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- bottom spacer - is followed by status "visible" checkbox -->
